***Replication Code for "Helping the Homeless" main text Tables, Figures, and associated tests**
**Kimberly Gross & Julie Wronski -- July 6, 2019**
**TESS and Qualtrics data combined in code**
**Data will have the variables in their original forms plus the renamed and cleaned variables**
**Cleaned variables are used in the code below**
**All analyses confined to respondents who saw at least 26 seconds of the treatment video**


**Figure 1**
**TESS
quietly eststo symp_all: mean symp01 if time_video_page>=26, over(block)
coefplot (symp_all), vertical coeflabels(_subpop_1 = "White No Information" _subpop_2= "White Information" _subpop_3 = "Black No Information" ///
	_subpop_4 = "Black Information", labsize(small)) ytitle("Mean Expressed Sympathy") ///
	title("TESS Sample", size(medlarge)) mlabel format(%9.2g) 
**Qualtrics
quietly eststo symp_all: mean sympathy if total_time_video>=26 & video_work==1 | block==1, over(block)
coefplot (symp_all), vertical coeflabels(_subpop_1 = "Control" _subpop_2 = "White No Information" _subpop_3= "White Information" _subpop_4 = "Black No Information" ///
	_subpop_5 = "Black Information", labsize(small)) ytitle("Mean Expressed Sympathy") ///
	title("Qualtrics Sample", size(medlarge)) mlabel format(%9.2g) 

**What are the effects of information on sympathy for each race condition & do they differ across race conditions?**
**TESS**
reg symp01 i.empathy_treat##i.black_treat if time_video_page>=26, robust
margins, dydx(empathy_treat) at(black_treat=(0 1))
**Qualtrics
reg sympathy i.empathy_condition##i.race_condition gender if total_time_video>=26 & video_work==1, robust
margins, dydx(empathy_condition) at(race_condition=(0 1))
**Qualtrics -- using combined positive emotions of sympathy, caring, and empathizing 
reg emp_emotion empathy_condition race_condition gender if total_time_video>=26 & video_work==1 | block==1, robust
reg emp_emotion white_highempth black_lowempth black_highempth control gender if total_time_video>=26 & video_work==1 | block==1, robust
reg emp_emotion i.empathy_condition##i.race_condition gender if total_time_video>=26 & video_work==1, robust
margins, dydx(race_condition) at(empathy_condition=(0 1))
reg emp_emotion white_lowempth white_highempth black_lowempth black_highempth gender if total_time_video>=26 & video_work==1 | block==1, robust

**Figure 2**
**TESS
quietly eststo govt_all: mean policy01 if time_video_page>=26, over(treatment)
coefplot (govt_all), vertical coeflabels(_subpop_1 =  "White No Information" _subpop_2= "White Information" _subpop_3 = "Black No Information" ///
	_subpop_4 = "Black Information", labsize(small)) ytitle("Mean Gov't Assistance Preferences") ///
	title("TESS Sample", size(medlarge)) mlabel format(%9.2g) 
**Qualtrics
quietly eststo govt_all: mean govt_help if total_time_video>=26 & video_work==1 | block==1, over(block)
coefplot (govt_all), vertical coeflabels(_subpop_1 = "Control" _subpop_2 = "White No Information" _subpop_3= "White Information" _subpop_4 = "Black No Information" ///
	_subpop_5 = "Black Information", labsize(small)) ytitle("Mean Gov't Assistance Preferences") ///
	title("Qualtrics Sample", size(medlarge)) mlabel format(%9.2g) 

**What are the effects of information on gov't policy for each race condition & do they differ across race conditions?**
**TESS
reg policy01 i.empathy_treat##i.black_treat if time_video_page>=26, robust
margins, dydx(empathy_treat) at(black_treat=(0 1))	
**Qualtrics
reg govt_help i.empathy_condition##i.race_condition gender if total_time_video>=26 & video_work==1 | block==1 , robust
margins, dydx(empathy_condition) at(race_condition=(0 1))
**Qualtrics -- using single government effort to end homelessness item that replicates TESS 
reg effort01 i.empathy_condition##i.race_condition gender if total_time_video>=26 & video_work==1 | block==1 , robust
margins, dydx(empathy_condition) at(race_condition=(0 1))
margins, dydx(race_condition) at(empathy_condition=(0 1))


**Figure 3**
**TESS**
quietly eststo donate_treat: mean donate if time_video_page>=26, over(treatment)
coefplot (donate_treat), vertical coeflabels(_subpop_1 =  "White No Information" _subpop_2= "White Information" _subpop_3 = "Black No Information" ///
	_subpop_4 = "Black Information", labsize(small)) ytitle("Mean Amount Donated") ///
	title("TESS Sample", size(medlarge)) mlabel format(%9.3g) 
**Qualtrics
quietly eststo donate_treat: mean donate if total_time_video>=26 & video_work==1| block==1, over(block)
coefplot (donate_treat), vertical coeflabels(_subpop_1 = "Control" _subpop_2 = "White No Information" _subpop_3= "White Information" _subpop_4 = "Black No Information" ///
	_subpop_5 = "Black Information", labsize(small)) ytitle("Mean Amount Donated") ///
	title("Qualtrics Sample", size(medlarge)) mlabel format(%9.3g) 

**What are the effects of information on donation amount for each race condition & do they differ across race conditions?**
**Qualtrics (since null effects in TESS)
reg donate i.race_condition##i.empathy_condition gender if total_time_video>=26 & video_work==1, robust
margins, dydx(empathy_condition) at(race_condition=(0 1))


**Figure 4**
**TESS**
quietly eststo pdonate_treat: mean donate01 if time_video_page>=26, over(treatment)
coefplot (pdonate_treat), vertical coeflabels(_subpop_1 =  "White No Information" _subpop_2= "White Information" _subpop_3 = "Black No Information" ///
	_subpop_4 = "Black Information", labsize(small)) ytitle("Predicted Probability of Donating") ///
	title("TESS Sample", size(medlarge)) mlabel format(%9.2g) 
**Qualtrics**
quietly eststo pdonate_treat: mean donate01 if total_time_video>=26 & video_work==1 | block==1, over(block)
coefplot (pdonate_treat), vertical coeflabels(_subpop_1 = "Control" _subpop_2 = "White No Information" _subpop_3= "White Information" _subpop_4 = "Black No Information" ///
	_subpop_5 = "Black Information", labsize(small)) ytitle("Predicted Probability of Donating") ///
	title("Qualtrics Sample", size(medlarge)) mlabel format(%9.2g) 


**Figure 5**
**Qualtrics only
**donation amount
reg donate c.rr_total##i.block gender if total_time_video>=26 & video_work==1 | block==1, robust
margins, at(rr_total=(0 (.5) 1) block=(1 2 3 4 5))
mplotoffset, offset(0.05) xtitle("Racial Resentment") ytitle("Predicted Amount Donated") ///
	title("Predicted Mean Amount Donated - Qualtrics", ///
	size(medlarge)) legend(cols(5) rows(1) position(6))
**probability of donating
logit donate01 c.rr_total##i.block gender if total_time_video>=26 & video_work==1 | block==1, robust
margins, at(rr_total=(0 (.5) 1) block=(1 2 3 4 5))
mplotoffset, offset(0.05) xtitle("Racial Resentment") ytitle("Pr(Donating)") ///
	title("Predicted Probability of Donating - Qualtrics", size(medlarge)) legend(cols(5) rows(1) position(6))

**Do the treatments work differently at the low and high ends of the racial resentment scale?
**relative to the control?
reg donate c.rr_total##i.block gender if total_time_video>=26 & video_work==1 | block==1, robust
margins, dydx(block) at(rr_total=(0 1))
logit donate01 c.rr_total##i.block gender if total_time_video>=26 & video_work==1 | block==1, robust
margins, dydx(block) at(rr_total=(0 1))
**relative to the White information?
reg donate c.rr_total##i.block_winfo gender if total_time_video>=26 & video_work==1 | block==1, robust
margins, dydx(block_winfo) at(rr_total=(0 1))
logit donate01 c.rr_total##i.block_winfo gender if total_time_video>=26 & video_work==1 | block==1, robust
margins, dydx(block_winfo) at(rr_total=(0 1))


**Figure 6** 
**TESS only
**donation amount
reg donate_alt c.eyes_total##i.treatment if time_video_page>=26, robust
margins, at(eyes_total=(0 (5) 10) treatment=(1 2 3 4))
mplotoffset, offset(.5) xtitle("Reading the Mind in the Eyes Score") ytitle("Predicted Amount Donated") ///
	title("Predicted Mean Amount Donated - TESS", size(medlarge)) legend(cols(5) rows(1) position(6))
**probability of donating
logit donate01 c.eyes_total##i.treatment if time_video_page>=26, robust
margins, at(eyes_total=(0 (5) 10) treatment=(1 2 3 4))
mplotoffset, offset(.5) xtitle("Reading the Mind in the Eyes Score") ytitle("Pr(Donating)") ///
	title("Predicted Probability of Donating - TESS", size(medlarge)) legend(cols(5) rows(1) position(6))

**Do the treatments work differently at the low and high ends of the racial resentment scale?
reg donate_alt c.eyes_total##i.treatment if time_video_page>=26, robust
margins, dydx(treatment) at(eyes_total=(0 10))
logit donate01 c.eyes_total##i.treatment if time_video_page>=26, robust
margins, dydx(treatment) at(eyes_total=(0 10))
**relative to the Black No Information condition?		
reg donate_alt c.eyes_total##i.treatment_bnoinfo if time_video_page>=26, robust
margins, dydx(treatment_bnoinfo) at(eyes_total=(0 10))
logit donate01 c.eyes_total##i.treatment_bnoinfo if time_video_page>=26, robust
margins, dydx(treatment_bnoinfo) at(eyes_total=(0 10))
